function x = cheb_grid(N, xmin, xmax)
  % constructs a chebyshev grid of N points between xmin and xmax 
  % adapted from trefethen
  x = (xmin - xmax)./2.*(cos(pi*(2*(0:N-1))./(2*(N-1)))-1) + xmin;
end
